﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using CrystalDecisions.Shared;

namespace GestionRecaudos
{
    public class RptParameter
    {
        private string name = string.Empty;
        private string value = string.Empty;
        private ParameterField paramField = null;
        private ParameterDiscreteValue paramDiscreteValue = null;
        private ParameterValues paramValues = null;

        public ParameterField ParamField
        {
            get { return paramField; }
            //set { paramField = value; }
        }

        public ParameterDiscreteValue ParamDiscreteValue
        {
            get { return paramDiscreteValue; }
            //set { paramDiscreteValue = value; }
        }

        public ParameterValue ParamValue
        {
            get
            {
                if (this.paramValues.Count == 0)
                {
                    return null;
                }
                else
                {
                    return paramValues[0];
                }
            }
            //set { paramValues = value; }
        }

        public string Name
        {
            get { return name; }
            //set { name = value; }
        }

        public string Value
        {
            get { return this.value; }
            //set { this.value = value; }
        }

        public RptParameter(string name, string value)
        {
            this.name = name;
            this.value = value;

            paramField = new ParameterField();
            paramDiscreteValue = new ParameterDiscreteValue();
            paramValues = new ParameterValues();

            paramField.ParameterFieldName = name;
            paramDiscreteValue.Value = value;
            paramValues.Add(paramDiscreteValue);
            paramField.CurrentValues = paramValues;
        }
    }
}
